Use the Operation API to save changes to several items of the same type in a single request. The following changes are allowed in an operation:
delete: Multiple items of the same type. Any item that supports the delete operation can be deleted using the Operation API.
Agent update: Update multiple agents.
operationType: Indicates if the items specified in the refURLs should be updated or deleted. Values are update/delete.
refURLs: A collection of refURL parameters indicating which items are included in the request. See Shared Parameters.
changeset: Includes the parameters that are changed in an update operation. See Agent API.
<operation> <operationType>delete</operationType> <refURLs> <refURL>/unifiedconfig/config/calltype/5000</refURL> <refURL>/unifiedconfig/config/calltype/5001</refURL> </refURLs> </operation>
<operation>
<operationType>update</operationType>
<refURLs>
<refURL>/unifiedconfig/config/agent/5000</refURL>
<refURL>/unifiedconfig/config/agent/5001</refURL>
</refURLs>
<changeSet>
<agent>
<description>New description</description>
<agentDeskSettings>
<refURL>/unifiedconfig/config/agentdesksetting/5434</refURL>
</agentDeskSettings>
<agentTeam>
<refURL>/unifiedconfig/config/agentteam/5000</refURL>
</agentTeam>
<skillGroupsAdded>
<skillGroup>
<refURL>/unifiedconfig/config/skillgroup/6000</refURL>
</skillGroup>
</skillGroupsAdded>
<skillGroupsRemoved>
<skillGroup>
<refURL>/unifiedconfig/config/skillgroup/6001</refURL>
</skillGroup>
</skillGroupsAdded>
</changeSet>
</operation>
The following example shows the response when the delete operation is successful:
<operationsResult> <status>success</status> </operationsResult>
The following example shows a partial success response for a request to delete several agents:
<operationsResult> <apiErrors> <apiError> <errorDetail xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type= "resourceErrorDetail"> <refURL>agent/1</refURL> <apiErrors> <apiError> <errorMessage>The specified ID does not exist in the database.</errorMessage> <errorType>notFound.dbData</errorType> </apiError> </apiErrors> </errorDetail> <errorMessage>There were one or more errors processing the following request: delete agent/1</errorMessage> <errorType>operation.resourceErrors</errorType> </apiError> <apiError> <errorDetail xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type= "resourceErrorDetail"> <refURL>agent/2</refURL> <apiErrors> <apiError> <errorMessage>The specified ID does not exist in the database.</errorMessage> <errorType>notFound.dbData</errorType> </apiError> </apiErrors> </errorDetail> <errorMessage>There were one or more errors processing the following request: delete agent/2</errorMessage> <errorType>operation.resourceErrors</errorType> </apiError> </apiErrors> <status>partialSuccess</status> </operationsResult>
The following example shows a failure response for a request to delete a call type that does not exist:
<operationsResult> <status>failure</status> <apiErrors> <apiError> <errorDetail xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type= "resourceErrorDetail"> <refURL>/unifiedconfig/config/calltype/9999</refURL> <apiErrors> <apiError> <errorMessage>The specified ID does not exist in the database.</errorMessage> <errorType>notFound.dbData</errorType> </apiError> </apiErrors> </errorDetail> <errorMessage>There were one or more errors processing the following request: delete /unifiedconfig/config /calltype/9999</errorMessage> <errorType>operation.resourceErrors</errorType> </apiError> </apiErrors> </operationsResult>